package com.wuliu.servlet;

import com.wuliu.dao.BusinessClassDAO;
import com.wuliu.dao.impl.BusinessClassDAOImpl;
import com.wuliu.model.BusinessClass;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/page11")
public class ContactServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        BusinessClassDAO businessClassDAO= new BusinessClassDAOImpl();
        List<BusinessClass> businessClasses =businessClassDAO.findAll();
        req.setAttribute("businessClasses",businessClasses);

        req.getRequestDispatcher("/WEB-INF/view/contact.jsp").forward(req,resp);
    }


}
